package com.ruoyi.adopt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.adopt.mapper.ApplyRecordMapper;
import com.ruoyi.adopt.domain.ApplyRecord;
import com.ruoyi.adopt.service.IApplyRecordService;

import javax.annotation.Resource;

/**
 * 记录Service业务层处理
 *
 * @author shilling
 * @date 2022-04-08
 */
@Service
public class ApplyRecordServiceImpl implements IApplyRecordService
{
    @Resource
    private ApplyRecordMapper applyRecordMapper;

    /**
     * 查询记录
     *
     * @param applyRecordId 记录主键
     * @return 记录
     */
    @Override
    public ApplyRecord selectApplyRecordByApplyRecordId(Long applyRecordId)
    {
        return applyRecordMapper.selectApplyRecordByApplyRecordId(applyRecordId);
    }

    /**
     * 查询记录列表
     *
     * @param applyRecord 记录
     * @return 记录
     */
    @Override
    public List<ApplyRecord> selectApplyRecordList(ApplyRecord applyRecord)
    {
        return applyRecordMapper.selectApplyRecordList(applyRecord);
    }

    /**
     * 新增记录
     *
     * @param applyRecord 记录
     * @return 结果
     */
    @Override
    public int insertApplyRecord(ApplyRecord applyRecord)
    {
        applyRecord.setApplyTime(DateUtils.getNowDate());
        return applyRecordMapper.insertApplyRecord(applyRecord);
    }

    /**
     * 修改记录
     *
     * @param applyRecord 记录
     * @return 结果
     */
    @Override
    public int updateApplyRecord(ApplyRecord applyRecord)
    {
        return applyRecordMapper.updateApplyRecord(applyRecord);
    }

    /**
     * 批量删除记录
     *
     * @param applyRecordIds 需要删除的记录主键
     * @return 结果
     */
    @Override
    public int deleteApplyRecordByApplyRecordIds(Long[] applyRecordIds)
    {
        return applyRecordMapper.deleteApplyRecordByApplyRecordIds(applyRecordIds);
    }

    /**
     * 删除记录信息
     *
     * @param applyRecordId 记录主键
     * @return 结果
     */
    @Override
    public int deleteApplyRecordByApplyRecordId(Long applyRecordId)
    {
        return applyRecordMapper.deleteApplyRecordByApplyRecordId(applyRecordId);
    }
}
